package com.store.controller;

import com.store.entity.DictDistrict;
import com.store.service.IDictDistrictService;
import com.store.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author cai
 * @since 2022-07-12
 */
@RestController
@RequestMapping("district")
public class DictDistrictController extends BaseController{
    @Autowired
    IDictDistrictService iDictDistrictService;

    @GetMapping({"","/"})
    public JsonResult<List<DictDistrict>> district(String parent ){
        List<DictDistrict> data=iDictDistrictService.selectByParent(parent);
        System.out.println(parent);
        System.out.println(data);
        return new JsonResult<>(OK,data);
    }
}
